use "build/output/crypto_daily_panel.dta", clear

// set date
drop if date > mdy(11,5,2022)
keep if stablecoin == 1

// get ordered list of stablecoins by market cap in 2021
preserve
keep if stablecoin == 1
keep if year(date) == 2021
collapse (mean) market_cap, by(coin)
sort market_cap
restore

estpost tabstat p, by(coin) stat(N)
estpost tabstat redemptions_millions, by(coin) stat(N mean p95) 
estpost tabstat redemptions_share, by(coin) stat(N mean  p95) 
estpost tabstat redemptions_millions redemptions_share if year(date)>2019, by(coin) stat(max) 
